package com.czkevin.wusan;

import com.czkevin.cif.ItemRegister;
import com.czkevin.wusan.items.AnswerRipper;
import com.czkevin.wusan.items.WuSanBiology;
import com.czkevin.wusan.items.WuSanChinese;
import com.czkevin.wusan.items.WuSanMath;
import com.czkevin.wusan.listeners.ItemSwitchListener;
import com.czkevin.wusan.tasks.CheckEffectTask;
import com.czkevin.wusan.tasks.WuSanExplodeCheckTask;
import org.bukkit.plugin.java.JavaPlugin;

public final class WuSanMod extends JavaPlugin {

    @Override
    public void onEnable() {
        getLogger().info("Registering CIF items... ");
        ItemRegister.register(new WuSanBiology());
        ItemRegister.register(new WuSanChinese());
        ItemRegister.register(new WuSanMath());
        ItemRegister.register(new AnswerRipper());

        getServer().getPluginManager().registerEvents(new ItemSwitchListener(), this);

        getServer().getScheduler().runTaskTimer(this,
            new CheckEffectTask(), 200L, 20L);

        getServer().getScheduler().runTaskTimer(this,
            new WuSanExplodeCheckTask(), 1L, 20L);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

}
